from typing import *


class Solution:
    def divisibilityArray(self, word: str, m: int) -> List[int]:
        num = 0
        ans = []
        for i in word:
            num += int(i)
            num %= m
            ans.append(int(num == 0))
            num *= 10
        return ans


s = Solution()
print(s.divisibilityArray(word="998244353", m=3))
